package com.zyb.ext.mymvc.controller;


import com.zyb.ext.mymvc.entry.ProductDto;
import com.zyb.ext.mymvc.annotate.ExtController;
import com.zyb.ext.mymvc.annotate.ExtRequestMapping;

import java.math.BigDecimal;

@ExtController
@ExtRequestMapping("/ext")
public class IndexController {

    @ExtRequestMapping("/index")
    public String indexTest() {
        System.out.println("手写SpringMVC 执行顺利...");
        return "firstPage";
    }

    @ExtRequestMapping("/getProductInfo")
    public ProductDto getProductInfo() {
        ProductDto productDto = new ProductDto();
        productDto.setId(1);
        productDto.setName("iphone note10");
        productDto.setSellPrice(new BigDecimal(4999));
        return productDto;
    }
}
